<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ include file="/common/pre/header.jsp"%>
<script src="${ctx}/statics/js/backend/backend.js"></script>
</head>
<body>
	<%@ include file="/common/backend/searchBar.jsp"%>
	<!--End Header End-->
	<div class="i_bg bg_color">
		<!--Begin 用户中心 Begin -->
		<div class="m_content">
			<%@ include file="/common/backend/leftBar.jsp"%>
			<div class="m_right" id="content">
				<div class="mem_tit">商品列表</div>
				<br>
					<table border="0" class="order_tab"
						style="width: 930px; text-align: center; margin-bottom: 30px;"
						cellspacing="0" cellpadding="0">
						<tbody>
							<tr>
								<td width="10%">商品名称</td>
								<td width="10%">商品图片</td>
								<td width="5%">库存</td>
								<td width="10%">价格</td>
								<td width="10%" colspan="2">操作</td>
							</tr>
							<c:forEach items="${pageUtil.list}" var="temp">
								<tr>
									<td>${temp.name}</td>
									<td><a
										href="${ctx}/Product?action=queryProductDeatil&id=${temp.id}"
										target="_blank"> <img src="${ctx}/files/${temp.fileName}"
											width="50" height="50" />
									</a></td>
									<td>${temp.stock}</td>
									<td>${temp.price}</td>
									<td><a
										href="${ctx}/admin/product?action=toUpdateProduct&id=${temp.id}">修改</a></td>
									<td><a href="javascript:void(0);"
										onclick="deleteById('${temp.id}');">删除</a></td>
								</tr>
							</c:forEach>
						</tbody>
					</table> <!-- 分页条 begin-->
					<div class="pages">
						<c:if test="${pageUtil.totalPage>=1}">
							<c:set var="url"
								value="AdminProductServlet?action=index"></c:set>
							<a href="${ctx}/${url }&currPageNo=1" class="p_pre">首页</a>
							<c:if test="${pageUtil.currPageNo>1}">
								<a href="${ctx}/${url}&currPageNo=${pageUtil.currPageNo-1}"
									class="p_pre">上一页</a>
							</c:if>
							<c:forEach var="temp"
								begin="${pageUtil.currPageNo>3?pageUtil.currPageNo-3:1}"
								end="${pageUtil.totalPage-pageUtil.currPageNo>3?pageUtil.currPageNo+3:pageUtil.totalPage}"
								step="1">
								<c:if test="${pageUtil.currPageNo==temp}">
									<a href="${ctx}/${url}&currPageNo=${temp}" class="cur">${temp}</a>
								</c:if>
								<c:if test="${pageUtil.currPageNo!=temp}">
									<a href="${ctx}/${url}&currPageNo=${temp}">${temp}</a>
								</c:if>
							</c:forEach>
							<c:if test="${pageUtil.currPageNo<pageUtil.totalPage}">
								<a href="${ctx}/${url}&currPageNo=${pageUtil.currPageNo+1}"
									class="p_pre">下一页</a>
							</c:if>
							<a href="${ctx}/${url}&currPageNo=${pageUtil.totalPage}"
								class="p_pre">尾页</a>
						</c:if>
						<c:if test="${pageUtil.totalPage==0}">
				        暂无记录
				    </c:if>
					</div> <!-- 分页条 end-->
			</div>
		</div>
		<%@ include file="/common/pre/footer.jsp"%>
	</div>
</body>
</html>


